#
# 多重継承のテスト
#
package Foo;

sub new {
  my ($type, $a) = @_;
  my $obj = {'a' => $a };
  bless $obj, $type;
  $obj;
}

sub get_a {
  my $obj = shift;
  $obj->{'a'};
}

sub method_1 {
  print "Foo::method_1\n";
}

package Bar;

sub new {
  my ($type, $b) = @_;
  my $obj = {'b' => $b };
  bless $obj, $type;
  $obj;
}

sub get_b {
  my $obj = shift;
  $obj->{'b'};
}

sub method_1 {
  print "Bar::method_1\n";
}

package Baz;
@ISA = (Foo, Bar);

sub new {
  my ($type, $a, $b) = @_;
  my $obj = {'a' => $a, 'b' => $b };
  bless $obj, $type;
  $obj;
}


package main;

# $o1 = Baz->new(10,20);
# 間接記法
$o1 = new Baz 10, 20;
print $o1->get_a(), "\n";
print $o1->get_b(), "\n";
$o1->method_1();

